<ui:composition template="../principal.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:define name="principal">
        <h2>Clinica</h2>
        <div id="titulo-inicial">
            <h3>Escolha uma opção para Clínicas</h3>
            <h:graphicImage id="separador-conteudo" library="images" name="separador-conteudo.png"/>
            <br/>
        </div>
        <h:form>
            <h:panelGrid columns="5" styleClass="sub-opcoes">
                <c:if test="#{loginMB.dentista.contaUsuario.tipo == 'AD'}" >  
                    <h:link outcome="../user-master/menuMaster.xhtml">
                        <h:graphicImage library="images" name="icones/inicio2.png"/>
                        <br/>
                        <h:outputText value="Painel"/>
                    </h:link>
                </c:if>
                <c:if test="#{loginMB.dentista.contaUsuario.tipo == 'DE'}" >  
                    <h:link outcome="../user-simple/menuDentista.xhtml">
                        <h:graphicImage library="images" name="icones/inicio2.png"/>
                        <br/>
                        <h:outputText value="Painel"/>
                    </h:link>  
                </c:if>
                <h:link outcome="../clinica/gerenciarEstoque.xhtml">
                    <h:graphicImage library="images" name="icones/estoque.png"/>
                    <br/>
                    <h:outputText value="Estoque"/>
                </h:link>
                <h:link outcome="../clinica/gerenciarServicos.xhtml">
                    <h:graphicImage library="images" name="icones/servico.png"/>
                    <br/>
                    <h:outputText value="Serviços"/>
                </h:link>
                <h:link outcome="../clinica/emitirRelatorioGerencial.xhtml">
                    <h:graphicImage library="images" name="icones/relatorio.png"/>
                    <br/>
                    <h:outputText value="Relatórios"/><br/>
                    <h:outputText value="Gerenciais"/>
                </h:link>
                <h:link outcome="../clinica/configuracaoClinica.xhtml">
                    <h:graphicImage library="images" name="icones/configuracao-clinica.png"/>
                    <br/>
                    <h:outputText value="Configurações"/>
                </h:link>
            </h:panelGrid>
        </h:form>
        
        <h:form id="grafico">
            <p:barChart id="basic" value="#{adminClinicaMB.categoryModel}" legendPosition="ne" seriesColors="4E6F1C" styleClass="grafico" 
                        animate="true" title="Itens de Estoque com menor quantidade" orientation="horizontal" >
                <p:ajax event="itemSelect" listener="#{adminClinicaMB.itemSelect}" update=":dialog" oncomplete="itemDialog.show()" />
            </p:barChart> 
        </h:form>
        
        <h:form id="dialog">
            <p:dialog header="Detalhes do Item de Estoque" widgetVar="itemDialog" resizable="false" id="itemDlg" dynamic="true" 
                      showEffect="fade" hideEffect="fade" modal="true">
                <h:panelGrid id="display" columns="1" width="400">
                    <h:panelGrid columns="2" cellspacing="10">
                        <h:outputText value="NOME: " styleClass="rotulo" />
                        <h:outputText value="#{adminClinicaMB.itemEstoqueSelecionado.nome}" style="font-weight:bold"/>                   

                        <h:outputText value="FORNECEDOR: " styleClass="rotulo" />
                        <h:outputText value="#{adminClinicaMB.itemEstoqueSelecionado.fornecedor}" style="font-weight:bold"/>

                        <h:outputText value="VALOR: " styleClass="rotulo" />
                        <h:outputText value="R$ #{adminClinicaMB.itemEstoqueSelecionado.preco}" style="font-weight:bold"/>

                        <h:outputText value="QUANTIDADE: " styleClass="rotulo" />
                        <h:outputText value="#{adminClinicaMB.itemEstoqueSelecionado.quantidade_estoque} unidade(s)" style="font-weight:bold"/>
                    </h:panelGrid>

                    <h:panelGrid columns="1" cellspacing="10">
                        <h:outputText value="DESCRIÇÃO: " />
                        <h:outputText value="#{adminClinicaMB.itemEstoqueSelecionado.descricao}" style="font-weight:bold"/>
                    </h:panelGrid>

                </h:panelGrid>
            </p:dialog>
        </h:form>
    </ui:define>
</ui:composition>


